package thread;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @ Title
 * @ Description:
 * @ Auther: 赵彦博
 * @ Date: 2023-01-04
 * @ Time: 10:53
 */
@SuppressWarnings({"all"})
public class Demo16 {
    public static volatile int isQuit = 0;

    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            while (isQuit == 0) {

            }
            System.out.println("循环结束！ t 线程退出！");
        });
        t.start();

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个isQuit的值：");
        isQuit = scanner.nextInt();
        System.out.println("main 线程执行完毕！");
    }
}
